package com.legendshop.openportal.sdk.model.request.v4;

import com.legendshop.openportal.sdk.annotation.EnumValid;
import com.legendshop.openportal.sdk.model.BaseRequest;
import com.legendshop.openportal.sdk.model.constants.AccountTypeEnum;
import com.legendshop.openportal.sdk.model.constants.AppTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import static com.legendshop.openportal.sdk.model.constants.ApiPathConstantsV4.USER_INFO_V4;

/**
 * 用户信息查询
 */
@Data
public class UserInfoV4Request extends BaseRequest {

    @ApiModelProperty(value = "店铺ID", required = true)
    @NotNull(message = "店铺ID不能为空")
    private Long shopId;

    /**
     * 枚举：AppTypeEnum
     */
    @ApiModelProperty("app类型，MP：公众号，MINI：小程序")
    @EnumValid(target = AppTypeEnum.class, message = "app类型不能为空")
    private String appType;

    @ApiModelProperty(value = "账号ID", required = true)
    @Length(max = 64, message = "账号ID长度不能超过64位")
    @NotBlank(message = "账号ID不能为空")
    private String accountId;

    @ApiModelProperty(value = "账号类型", notes = "WX_UNION=微信unionid、MOBILE=手机号、ID=用户ID", required = true)
    @EnumValid(target = AccountTypeEnum.class, message = "账号类型不能为空")
    private String accountType;

    @Override
    public String getApiPath() {
        return USER_INFO_V4;
    }
}
